{template 'header', $module}

<link rel="stylesheet" type="text/css" href="/plugins/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="/plugins/bootstrap/css/bootstrap-dropdown-checkbox.css" />

<link rel="stylesheet" type="text/css" href="/skin/default/article.css">
<link rel="stylesheet" type="text/css" href="{DT_STATIC}{$MODULE[2][moduledir]}/image/index.css"/>


<script src="/plugins/bootstrap/js/bootstrap-dropdown-checkbox.js"></script>

<div id="warn">
{if $_groupid == 4}
	<div class="warn">尊敬的会员，您的帐号<span class="f_red">正在审核中..</span>，本站部分功能和服务可能受到一定的使用限制，{if $MOD[checkuser]==2}<a href="send.php?action=check" class="l">请点这里验证您的邮箱</a>，系统将自动审核{else}请稍候，等待网站审核<br/>完善的商业信息有助于获得别人的信任，结交潜在的商业伙伴，获取商业机会，增加系统审核通过的概率&nbsp;&nbsp;<a href="edit.php?tab=2" class="t">现在就去完善&raquo;</a>{/if}</div>
{/if}
{if $_groupid > 5 && !$_edittime}
	<div class="warn">贵公司尚未完善详细资料！完善的商业信息有助于获得别人的信任，结交潜在的商业伙伴，获取商业机会&nbsp;&nbsp;<a href="edit.php?tab=2" class="t">现在就去完善&raquo;</a></div>
{/if}
{if $vip && $havedays < 30 && $havedays > 0}
	<div class="warn">尊敬的{$MG[groupname]}，您的{VIP}服务将在 <strong class="f_red">{$havedays}</strong> 天后到期，为了不影响您的正常使用，请您尽快续费&nbsp;&nbsp;<a href="vip.php?action=renew" class="t">立即续费&raquo;</a></div>
{/if}
</div>

<div class="iuser">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="120" valign="top" align="center"><div class="iuser_avatar"><a href="avatar.php"><img src="{useravatar($_username, 'large')}" width="80" height="80"/></a></div></td>
<td valign="top" width="400">
<ul>
<li><span class="f_b px14" title="">欢迎，{$_truename}</span> ({$_username}) <a href="{$MODULE[2][linkurl]}line.php" title="{if $_online}在线，点击隐身{else}隐身，点击上线{/if}"><img src="{DT_SKIN}image/user_{if $_online}on{else}off{/if}line.png" width="10" height="10" align="absmiddle"/></a></li>
<li><a href="{$linkurl}" target="_blank">{$_company}</a>({$MG[groupname]})&nbsp;&nbsp;&nbsp;<a href="profile.php" class="t">账户详情&raquo;</a></li>
{if $MOD[vmember]}
<li style="display:none">
<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/{if $validated}v{else}u{/if}_member.gif" width="16" height="16" title="{if $validated}已通过{$validator}认证{else}未通过认证{/if}" align="absmiddle"/> 认证：
{if $MOD[vemail]}
<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/{if $vemail}v{else}u{/if}_email.gif" width="16" height="16" title="{if $vemail}已通过{else}未通过{/if}邮件认证" align="absmiddle"/> <a href="validate.php?action=email" class="l">邮件</a> &nbsp;
{/if}
{if $MOD[vmobile]}
<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/{if $vmobile}v{else}u{/if}_mobile.gif" width="16" height="16" title="{if $vmobile}已通过{else}未通过{/if}手机认证" align="absmiddle"/> <a href="validate.php?action=mobile" class="l">手机</a> &nbsp;
{/if}
{if $MOD[vbank]}
<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/{if $vbank}v{else}u{/if}_bank.gif" width="16" height="16" title="{if $vbank}已通过{else}未通过{/if}银行帐号认证" align="absmiddle"/> <a href="validate.php?action=bank" class="l">银行</a> &nbsp;
{/if}
{if $MOD[vtruename]}
<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/{if $vtruename}v{else}u{/if}_truename.gif" width="16" height="16" title="{if $vtruename}已通过{else}未通过{/if}真实姓名认证" align="absmiddle"/> <a href="validate.php?action=truename" class="l">实名</a> &nbsp;
{/if}
{if $MOD[vcompany] && $groupid > 5}
<img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/{if $vcompany}v{else}u{/if}_company.gif" width="16" height="16" title="{if $vcompany}已通过{else}未通过{/if}公司资料认证" align="absmiddle"/> <a href="validate.php?action=company" class="l">公司</a>
{/if}
</li>
{else}
<li>上次登录：{timetodate($logintime, 5)}</li>
{/if}
</ul>
</td>
<td valign="top">
	<div class="iuser_money" style="display:none">
	<p class="f_b px14">账户余额</p>
	<span class="my_money">{$DT[money_sign]}{$my_money}</span> {$DT[money_unit]}
	&nbsp;&nbsp;
	<a href="record.php" class="t">流水</a> <span class="f_gray">&nbsp;|&nbsp;</span> 
	<a href="cash.php" class="t">提现</a> <span class="f_gray">&nbsp;|&nbsp;</span> 
	<a href="charge.php?action=pay" target="_blank"><img src="{DT_STATIC}{$MODULE[2][moduledir]}/image/btn_charge.gif" width="40" height="18" alt="" align="absmiddle"/></a>
        <br /><br />
            <a href="#" onclick="Go('message.php');" class="t">新消息<span class="f_gray">({$_message})</span></a>&nbsp;&nbsp;&nbsp;
            <a href="#" onclick="Go('deposit.php');" class="t">保证金<span class="f_gray">({$deposit})</span></a>&nbsp;&nbsp;&nbsp;
            <a href="#" onclick="Go('credit.php');"  class="t">{$DT[credit_name]}<span class="f_gray">({$_credit})</span></a> 
	</div>	
        
           
        
</td>
</tr>
</table>
</div>
    <div class="icount">
        <table cellpadding="0" cellspacing="0">
            <tr>
                {if isset($MODULE[16])}
                    <td onclick="Go('{$MODULE[16][linkurl]}cart.php');"><div>购物车</div><span><script type="text/javascript">document.write(get_cart());</script></span></td>
                {/if}
                <!--
                    <td onclick="Go('message.php');" style="width: 208px;"><div>新消息</div><span>{$_message}</span></td>
                    <td onclick="Go('deposit.php');" style="width: 208px;"><div>保证金</div><span>{$deposit}</span></td>
                    <td onclick="Go('credit.php');" style="width: 208px;"><div>{$DT[credit_name]}</div><span>{$_credit}</span></td>
                -->
                {if $DT[sms] && $MG[sms]}
                    <td onclick="Go('sms.php');"><div>短信余额</div><span>{$_sms}</span></td>
                {/if}
            </tr>
        </table>
    </div>

    <style>
       .search-item{
           width:79.4%;
           height:123px;
           float:left;
           padding-top:5px;
           border:#e8e8e8 solid 1px; border-top:none;
       }
        
       .search-item-btn{          
           text-align:center;
           /*border:#e8e8e8 solid 1px; border-top:none; border-left:none;*/
       }
       
       .search-item-btn .btn {
            margin: 13px auto;
            width: 80%;
            height: 95px;
            border: solid 1px #e8e8e8;
            color: white;
            background: #3d95e6;
            font-size: 16px;
            font-weight: bolder;
       }
       
       .search-item-btn .btn:hover {
            margin: 13px auto;
            width: 80%;
            height: 95px;
            //border-width: 1px;
            border: solid 1px #e8e8e8;
            color: white;
            background: #3da6e6;
            font-size: 16px;
            font-weight: bolder;
       }
       
       .piaochecked {
            border:solid 1px #e8e8e8;
            border-radius:3px;
            height: 30px;
            float: left;
            cursor: pointer;
            margin-left: 10px;
            text-align: center;
            padding-left: 10px;
            padding-right: 10px;
            margin-top: 5px;
            margin-bottom: 5px;
        }
        
        .piaochecked:hover {           
            background-color:#d3dbe7;
        }

        .on_check {            
            background: #3d95e6; 
            color: white;
        }
        
        .on_check:hover {
            background-color:#3da6e6;
        }
        
        .radioclass {
            width: 14px;
            height: 14px;
            cursor:pointer;    
            vertical-align:middle !important; 
            margin-top:0 !important;
            opacity: 0;
            -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
            filter: alpha(opacity=0);
            
        }
        
        
        
        .styled-checkbox {
            opacity: 0;
            filter: alpha(opacity=0);
        }
        .styled-checkbox + label {
            position: relative;
        }
        .styled-checkbox + label:before,
        .lt-ie8 .checkbox-replacement {
            content: '';
            display: inline-block;
            visibility: visible;
            left: 0;
            width: 1em;
            height: 1em;
            margin: 0px 0.3em -3px -1em;
            line-height: 0.6;
            text-align: center;
            /* Put checkbox styles here: */
            border: 1px solid #87a2b3;
        }
        .styled-checkbox:checked + label:before,
        .lt-ie9 .styled-checkbox.checked + label:before {
            content: '✔';
        }
        
        .dropdown-checkbox-toggle {
            text-decoration: none !important;
        }
        
        .dropdown-checkbox-toggle:hover{
            text-decoration: none !important;
        }
        
        .dropdown-checkbox-content {
            border-radius: 0 !important;
            padding: 0 !important;
            border: solid 1px #aaa;
            margin-left:-20px;
        }
        
        .dropdown-checkbox .dropdown-checkbox-content li .layout:hover {
            background: #d3dbe7;
            color: black;
            cursor: pointer;
        }
        
        .dropdown-checkbox ul.dropdown-checkbox-menu {
            padding: 0 !important;
        }
        
        table.table-searchitem { width:100%;border:none }        
        table.table-searchitem > tbody > tr > td { padding-left:10px;min-height:35px;vertical-align: middle; border:solid 1px #e8e8e8; border-top:none; border-right: none }
        table.table-searchitem > tbody > tr > td:first-child { width:80px; }
        
        
    h3 {margin:5px;}
       
    .iuser ul {
        border-right: none;
        margin-top: 12px;
    }
    
        
        .catlist{
            overflow: hidden;
            margin-top: 0px;
            padding: 0px 0px 0px 0px;
            border: 1px solid #59abf7;
            border-top: 3px solid #3d80e6;
        }
        
        .catlist .label {
            display: block;
            padding:0;
        }
        
    
        .catlist .label li{       
            float:left;
            height:36px;
            line-height: 36px;          
            text-align: center;
            font-size: 14px;
            font-weight: bold;
            color: #ffffff;
            background: #3d95e6;
            /*background:#fff1e6;
            border-bottom: 1px solid #ffd5b3;*/
        }
        
        .ellipsis {
            overflow: hidden;
            text-overflow: ellipsis;
            display: block;
            white-space: nowrap;
        }

        .cut, .catlist-col1, .catlist-col2, .catlist-col3, .catlist-col4, .catlist-col5 {

            float: left;    
            text-align: center;
            height: 36px;
            line-height: 36px;
            border-bottom: dashed 1px #aaa;
        }
        
        
            .catlist-col1 {
                width:8%;
            }
            .cut{
                width:1%;
                color:#cccccc;
            }

            .catlist-col2 {
                width:45%;               
                text-align: left;
            }
            .catlist-col3 {
                width:16%;
            }
            .catlist-col4 {
                width:10%;
            }
            .catlist-col5 {
                width:20%;
            }
           
       

         .catlist_last {
                border-bottom: 0 !important;
            }
            
         .pos{
            //width: 700px;
            height: 36px;
            line-height: 36px;
            background: transparent;
        }
        .pos a{
                color: #fe5100;
                font-size: 12px;            
        }
       
        .box_head, .box_body{
            border: 1px #FFD5B3 solid;
            background: none;
            color: #f53200;
            font-size: 14px;
        }
        .box_body{
            border-top: none;
        }
        .box_head{
            border-bottom: none;
            background: #fff1e6 none repeat scroll 0 0;
            color: #fe5100;
            border-color: #fe5100 #ffd5b3 #ffd5b3;
            border-width: 3px 1px 1px;
        }
    
    
    
    </style>

    <table class="table-searchitem">
          <form method="POST" action="?"  >
         <tr>
            <td><strong style="float:left">关 键 词</strong></td>
            <td>
                <div style="width:100%; padding:5px 10px; height:36px;">
                    <input type="text" style="width:100%;" name="kw" value="{$kw}" class="pd3"/>
                </div>
                <input type="radio" name="fields" style="margin-left:20px" value="0" id="fd_0"{if $_fields==0} checked{/if}/><label for="fd_0"> 智能</label>&nbsp;
                <input type="radio" name="fields" style="margin-left:20px" value="1" id="fd_1"{if $_fields==1} checked{/if}/><label for="fd_1"> 标题</label>&nbsp;
                <input type="radio" name="fields" value="2" id="fd_1"{if $_fields==2} checked{/if}/><label for="fd_2"> 内容</label>&nbsp;

            </td>
            <td rowspan="4" style="width:140px">
               
                    <input type="hidden" id="filteraddress" name="areaid" value="<?php echo $search_areatext; ?>" style="width:60px" /> 
                    <input type="hidden" id="zp_category" name="zpcategory" value="<?php echo $search_zpcategorytext; ?>" style="width:60px" />
                    <input type="hidden" id="filtercategory" name="category" value="<?php echo $search_filtercategorytext; ?>"style="width:60px" />
                    
                    <div class="search-item-btn"> 
                        <button class="btn btn-primary">搜  索</button>
                    </div>
                
            </td>
        </tr>
        </form>
        <tr>
            <td>
                <strong style="float:left">服务区域</strong>
            </td>
            <td>
                <span class="piaochecked">
                    <input type='checkbox' id='area0' name="area0" class='styled-checkbox' onclick='addDistrict(0);' {$area0_checked} />
                    <label for='area0' style="font-weight:bold">全部</label>
                </span>
                <?php                 
                    foreach( $user_areas as $area )
                    {
                        echo  '<span class="piaochecked">';
                        echo  "<input type='checkbox' id='area" . $area["areaid"] . "' class='styled-checkbox area' onclick='addDistrict(" . $area["areaid"] . ");' ";
                        if( !empty($area["checked"]) )
                        {
                           echo  "checked='"  . $area["checked"] . "'";
                        }
                        echo  " />";
                        echo  "<label for='area" . $area["areaid"] . "'>" . $area["areaname"] . "</label>" ;
                        echo '</span>';
                    }                
                ?>
            </td>
        </tr>
        <tr>
            <td>
                <strong  style="float:left">行业分类</strong>
            </td>
            <td>
                <span class="piaochecked">
                    <input type='checkbox' id='cat_0' name="cat_0" class='styled-checkbox' onclick='addFilterCategory(0);' {$fcategory0_checked} />
                    <label for='cat_0' style="font-weight:bold">全部</label>
                </span>
                <?php 
                        foreach( $user_fcategories as  $index=>$fcategory )
                        {                            
                            if( !empty( $fcategory['child'] )) 
                            {
                               
                                echo  '<span class="piaochecked">';
                                
                                
                                echo  "<input type='checkbox' id='cat_" . $fcategory["id"] . "' class='styled-checkbox cat' onclick='addFilterCategory(" . $fcategory["id"] . ");' ";                        
                                if( !empty($fcategory["checked"]) )
                                {
                                   echo  "checked='"  . $fcategory["checked"] . "'";
                                }
                                echo " />";
                                
                                 
                                echo  '<label class="categoryList" for="cat_' . $fcategory["id"] . '" id="category'. $fcategory["id"] .'">';
                                echo  $fcategory["cat_name"] ;
                                echo  '</label>';                              
                                echo  '</span>';

                                echo "<script>";
                                echo "var catData" . $index . " = [";
                                foreach( $fcategory['child'] as $item )
                                {
                                    echo '{ id: "cat_' .  $item['id'] . '", catid: "' . $item['id'] . '", label: "' . $item['cat_name'] . '", ';
                                    
                                    if( !empty($item['checked']) )
                                    {
                                        echo ' isChecked: true ';
                                    }
                                    else
                                    {
                                        echo ' isChecked: false ';
                                    }                                    
                                    echo '}, ';
                                }
                                echo "]; ";                              
                                echo " $(document).ready( function(){ initCategory( '#category" . $fcategory["id"] . "', '" . $fcategory['cat_name'] . "', catData" . $index . " ); });";
                                echo "</script>";                                
                            }
                            else
                            {
                                echo  '<span  class="piaochecked">';                                
                                echo  "<input type='checkbox' id='cat_" . $fcategory["id"] . "' class='styled-checkbox cat' onclick='addFilterCategory(" . $fcategory["id"] . ");' ";                        
                                if( !empty($fcategory["checked"]) )
                                {
                                   echo  "checked='"  . $fcategory["checked"] . "'";
                                }
                                echo " />";
                                
                                echo  '<label for="cat_' . $fcategory["id"] . '" id="category'. $fcategory["id"] .'">';
                                echo  $fcategory["cat_name"] ;
                                echo  '</label>';                              
                                echo  '</span>';                                
                            } 
                        }
                    ?>
            </td>            
        </tr>
        <tr>
            <td>
                <strong style="float:left">招标分类</strong>
            </td>
            <td>
                <span class="piaochecked">
                    <input type='checkbox' id='catid0' name="catid0" class='styled-checkbox' onclick='addCategory(0);' {$category0_checked} />
                    <label for='catid0' style="font-weight:bold">全部</label>
                </span>
                <?php  
                    foreach( $user_categorys as $index=>$category )
                    {
                        echo  '<span class="piaochecked">';
                        echo  "<input type='checkbox' id='catid" . $category["catid"] . "'  class='styled-checkbox zpcat' onclick='addCategory(" . $category["catid"] . ");' ";
                        
                        if( !empty($category["checked"]) )
                        {
                           echo  "checked='"  . $category["checked"] . "'";
                        }
                        echo " />";
                        echo  "<label for='catid" . $category["catid"] . "'>" . $category["name"] . "</label>" ;
                        echo  '</span>';
                    }
                    
                ?>
            </td>
        </tr>
    </table>
    
    
    <script>
  function list(size, checked) {
    var result = [];
    for (var i = 0; i < size; i++) {
      result.push({
        id: i,
        label: 'Item #' + i,
        isChecked: checked === undefined ? !!(Math.round(Math.random() * 1)) : checked
      });
    }
    return result;
  }





  function p(wat) {
    return '<p>' + JSON.stringify(wat) + '</p>';
  }

  function updateStatus() {
    var $p = $('p.status').empty();

    $p.append(p(widget.checked()));
    
  }

   function initCategory( catCtrlId, catCtrlName, catData)
   {
       $(catCtrlId).dropdownCheckbox({
            data: catData,
            autosearch: false,
            title: catCtrlName,
            hideHeader: true,
            showNbSelected: true,
            templateButton: '<a class="dropdown-checkbox-toggle" data-toggle="dropdown" href="#"> '+ catCtrlName +' <span class="dropdown-checkbox-nbselected"></span> &nbsp;<b class="caret"></b>'
          });
   }
   
   
  
  
function addCategory( categoryId )
{
    var itemText =  "(" + categoryId + ")" ;
    var filterValue = $('#zp_category').val();
    
    if( categoryId == 0 )
    {
        itemText = '(0)';
        $('#zp_category').val( itemText );       
        $(".zpcat").prop("checked", false); 
       $("#catid0").prop("checked", true);
        reuturn;
    }
    
    $("#catid0").prop("checked", false);     
    filterValue = filterValue.replace("(0)", "");
    var iPos = filterValue.indexOf(itemText);
    if( iPos < 0)
    {
        if( filterValue == '')
        {
            $('#zp_category').val( itemText );
        }
        else
        {
            filterValue = filterValue + "," +  itemText;
            filterValue = filterValue.replace(/,,/, ",");
            $('#zp_category').val( filterValue  );
        }
    }
    else
    {
         filterValue = filterValue.replace(itemText, "");         
         filterValue = filterValue.replace(/,,/, ",");        
         $('#zp_category').val(  filterValue );
    }
    
}

function addFilterCategory( categoryId )
{
    var itemText =  "(" + categoryId + ")" ;
    var filterValue = $('#filtercategory').val();
    
    if( categoryId == 0 )
    {
        itemText = '(0)';
        $('#filtercategory').val( itemText );       
        $(".cat").prop("checked", false); 
        $("#cat_0").prop("checked", true);
        reuturn;
    }
    
    $("#cat_0").prop("checked", false);     
    filterValue = filterValue.replace("(0)", "");
    
    
    
    
    
    var iPos = filterValue.indexOf(itemText);
    if( iPos < 0)
    {
        if( filterValue == '')
        {
            $('#filtercategory').val( itemText );
        }
        else
        {
            filterValue = filterValue + "," +  itemText;
            filterValue = filterValue.replace(/,,/, ",");
            $('#filtercategory').val( filterValue  );
        }
    }
    else
    {
         filterValue = filterValue.replace(itemText, "");         
         filterValue = filterValue.replace(/,,/, ",");        
         $('#filtercategory').val(  filterValue );
    }
}


function addDistrict(areaId)
{
    var itemText =  "(" + areaId + ")" ;
    var filterValue = $('#filteraddress').val();
    
    if( areaId == 0 )
    {
        itemText = '(0)';
        $('#filteraddress').val( itemText );       
        $(".area").prop("checked", false); 
        $("#area0").prop("checked", true);
        reuturn;
    }
    
    $("#area0").prop("checked", false);     
    filterValue = filterValue.replace("(0)", "");
    var iPos = filterValue.indexOf(itemText);
    if( iPos < 0)
    {
        if( filterValue == '')
        {
            $('#filteraddress').val( itemText );
        }
        else
        {
            filterValue = filterValue + "," +  itemText;
            filterValue = filterValue.replace(/,,/, ",");
            $('#filteraddress').val( filterValue  );
        }
    }
    else
    {
         filterValue = filterValue.replace(itemText, "");
         filterValue = filterValue.replace(/,,/, ",");        
         $('#filteraddress').val(  filterValue );
    }
}

$(document).ready( function() {
    $(".child-checkbox").on("click", function(){
        var catid = $(this).attr("catid");
        addFilterCategory(catid);
    });
});
  
  
  

</script>
    


<div class="m">
    <div class="left_box">
        {if $tags}
            {template 'list-cat', 'tag'}
        {else}
            {template 'noresult', 'message'}
        {/if}
    </div>
</div>


    
{template 'footer', $module}